package com.xq.xq.kotlinlearnsingletom.kotlin

/**
 * @author aidenquan
 *         Created by junlintianxia on 2021/07/04.
 */
class SingletonBKt private constructor() {
    override fun toString(): String {
        return "SingletonBKt"
    }
    companion object {
        var ins: SingletonBKt? = null
            get() {
                if (field == null) {
                    field = SingletonBKt()
                }
                return field
            }
            private set

        fun getInstance(): SingletonBKt {
            return ins!!
        }
    }
}